package guan.shop.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("t_product")
public class Product {
    private Integer id;
    private String name;
    private BigDecimal price;
    private String productIntroImgs; // 商品介绍图片
    private String productParaImgs; // 商品规格参数图片

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getProductIntroImgs() {
        return productIntroImgs;
    }

    public void setProductIntroImgs(String productIntroImgs) {
        this.productIntroImgs = productIntroImgs;
    }

    public String getProductParaImgs() {
        return productParaImgs;
    }

    public void setProductParaImgs(String productParaImgs) {
        this.productParaImgs = productParaImgs;
    }

    public boolean isHot() {
        return isHot;
    }

    public void setHot(boolean hot) {
        isHot = hot;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public String getProPic() {
        return proPic;
    }

    public void setProPic(String proPic) {
        this.proPic = proPic;
    }

    public boolean isSwiper() {
        return isSwiper;
    }

    public void setSwiper(boolean swiper) {
        isSwiper = swiper;
    }

    public Integer getSwiperSort() {
        return swiperSort;
    }

    public void setSwiperSort(Integer swiperSort) {
        this.swiperSort = swiperSort;
    }

    public String getSwiperPic() {
        return swiperPic;
    }

    public void setSwiperPic(String swiperPic) {
        this.swiperPic = swiperPic;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getHotDateTime() {
        return hotDateTime;
    }

    public void setHotDateTime(Date hotDateTime) {
        this.hotDateTime = hotDateTime;
    }

    public Product(Integer id, String name, BigDecimal price, String productIntroImgs, String productParaImgs, boolean isHot, Integer stock, String proPic, boolean isSwiper, Integer swiperSort, String swiperPic, String description, Date hotDateTime) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.productIntroImgs = productIntroImgs;
        this.productParaImgs = productParaImgs;
        this.isHot = isHot;
        this.stock = stock;
        this.proPic = proPic;
        this.isSwiper = isSwiper;
        this.swiperSort = swiperSort;
        this.swiperPic = swiperPic;
        this.description = description;
        this.hotDateTime = hotDateTime;
    }

    public Product() {
    }

    private boolean isHot=false; // 是否热门推荐商品
    private Integer stock; // 库存
    private String proPic = "default.jpg";
    private boolean isSwiper = false;
    private Integer swiperSort = 0;
    private String swiperPic = "default.jpg"; // 商品轮播图图片
    private String description; // 商品描述
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    private Date hotDateTime; // 热门推荐时间
}
